home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compendium Deluxe 2
/
LSD and 17bit Compendium Deluxe - Volume II.iso
/
a
/
prog
/
asmsrc
/
phagexsources.lha
/
source
/
ShadeBob-Runner.s
< prev
next >
Wrap
Text File
|
1994-07-09
|
5KB
|
338 lines
; Runs yer standard Shadebob segment, i think we all know where shadebobs
; originated from (cough, hardwired, splutter!) hehe
; Also Cycles the palette
; RMB changes Bob and SineWave Pattern
Opt c-
Section "Phages ShadeBob Runner",Code_c
IncDir Df1:
Start Movem.l d0-d7/a0-a6,-(sp)
Bsr KillSys
Lea CopperList1(pc),a0
Move.l a0,$Dff080
Move.w #$83c0,$Dff096
Lea CycleStart(pc),a6
Lea Cycle0(pc),a0
Move.l a0,(a6)
Lea $c0000,a0
Moveq #4,d0
Bsr ShadeBob+$20
ReDoo Bsr ShadeBob+$22
Lea $c0000,a0
Move.l a0,a1
Add.l #5*$2e00,a1
ClearLoop Move.l #0,(a0)+
Cmp.l a0,a1
Bne ClearLoop
Loop Bsr VBL
Bsr DoCycle
Bsr ShadeBob+$24
Btst #2,$Dff016
Beq ReDoo
Btst #6,$Bfe001
Bne Loop
Quit Bsr ReturnSys
Movem.l (sp)+,d0-d7/a0-a6
Moveq #0,d0
Rts
VBL Move.l $Dff004,d0
And.l #$1ff00,d0
Cmp.l #$13000,d0
Bne VBL
Rts
BWait Btst #$6,$Dff002
Bne BWait
Rts
KillSys Bsr SysWait
Move.l $4,a6
Lea GFXLibName(pc),a1
Moveq #0,d0
Jsr -552(a6)
Lea OldCopper(pc),a5
Move.l $26(a0),(a5)
Lea $Dff000,a6
Move.w IntEnaR(a6),d0
Move.w DMAConR(a6),d1
Or.w #$8000,d0
And.w #$03ff,d1
Or.w #$8000,d1
Move.w #$7fff,IntEna(a6)
Move.w #$7fff,DMACon(a6)
Move.w d0,$4(a5)
Move.w d1,$6(a5)
Bset #1,$Bfe001
Rts
SysWait Move.w #15,d7
SWLoop1 Move.w #$1000,d0
SWLoop2 Move.w d0,$Dff182
Move.w d7,$Dff180
Dbf d0,SWLoop2
Dbf d7,SWLoop1
Rts
ReturnSys Lea $Dff000,a6
Move.w OldIntEna(pc),IntEna(a6)
Move.w OldDMACon(pc),DMACon(a6)
Move.l OldCopper(pc),Cop1lc(a6)
Rts
DoCycle Lea $Dff180,a0 ; Color 00 reg
Move.l CycleStart(pc),a1
Moveq #0,d0
Lea CyclePos(pc),a5
Move.w (a5),d0
Add.w #1,(a5)
Asl.w #1,d0
Add.l d0,a1
Move.w (a1)+,d0
Cmpi.w #$ffff,d0
Bne NotTabEnd
Move.w #0,(a5)
Bra DoCycle
NotTabEnd Move.w #31,d7
DoColoCyc Move.w d0,(a0)
Add.l #2,a0
RedooC Move.w (a1)+,d0
Cmpi.w #$ffff,d0
Bne NotColoL
Move.l CycleStart(pc),a1
Bra RedooC
NotColoL Dbf d7,DoColoCyc
NoCycle Rts
GFXLibName Dc.b "graphics.library",0,0,0,0
OldCopper Dc.l 0
OldIntEna Dc.w 0
OldDmaCon Dc.w 0
OldX Dc.b 0
OldY Dc.b 0
CycleStart Dc.l 0
CyclePos Dc.w 0
Cmv Macro
Dc.w \2,\1
EndM
Cwt Macro
Dc.w (\1*$100)+$01,$fffe
EndM
Pal Macro
Dc.w $ffe1,$fffe
EndM
EndCop Macro
Dc.w $ffff,$fffe
EndM
DatP Macro
Dc.w $e0+(\1*4),\2/$10000
Dc.w $e2+(\1*4),(\2-((\2/$10000)*$10000))
EndM
CopperList1 Cwt $15
Cmv $0200,BplCon0
Cmv $0000,BplCon1
Cmv $000a,BplCon2
Cmv $0038,DdfStrt
Cmv $00d0,DdfStop
Cmv $1681,DiwStrt
Cmv $36c1,DiwStop
Cmv $0000,BplMod1
Cmv $0000,BplMod2
Cwt $16
CopperCOLS Cmv $0000,Color00
Cmv $0fff,Color01
Cmv $0eee,Color02
Cmv $0ddd,Color03
Cmv $0ccc,Color04
Cmv $0bbb,Color05
Cmv $0aaa,Color06
Cmv $0999,Color07
Cmv $0888,Color08
Cmv $0777,Color09
Cmv $0666,Color10
Cmv $0555,Color11
Cmv $0444,Color12
Cmv $0333,Color13
Cmv $0222,Color14
Cmv $0111,Color15
Cmv $0000,Color16
Cmv $0001,Color17
Cmv $0002,Color18
Cmv $0003,Color19
Cmv $0004,Color20
Cmv $0005,Color21
Cmv $0006,Color22
Cmv $0007,Color23
Cmv $0008,Color24
Cmv $0009,Color25
Cmv $000a,Color26
Cmv $000b,Color27
Cmv $000c,Color28
Cmv $000d,Color29
Cmv $000e,Color30
Cmv $000f,Color31
Cwt $20
CopperBPLS Cmv $000c,BplPt0h
Cmv $0000,BplPt0l
Cmv $000c,BplPt1h
Cmv $2e00,BplPt1l
Cmv $000c,BplPt2h
Cmv $5c00,BplPt2l
Cmv $000c,BplPt3h
Cmv $8a00,BplPt3l
Cmv $000c,BplPt4h
Cmv $b800,BplPt4l
Cwt $21
Cmv $5200,BplCon0
Pal
Cwt $38
Cmv $0200,BplCon0
Cmv $0000,Color00
EndCop
Cycle0 Incbin df0:SysData/CL3
Dc.w -1,-1
ShadeBob Incbin df0:CodeSegments/ShadeBob-Seg
****Custom Chip Registers****
;Control Registers
Dmaconr = $002
Vposr = $004
Vhposr = $006
Joy0dat = $00A
Joy1dat = $00C
Clxdat = $00E
Intenar = $01C
Intereqr = $01E
Copcon = $02E
;Blitter Registers
Bltcon0 = $040
Bltcon1 = $042
Bltafwm = $044
Bltalwm = $046
Bltcpth = $048
Bltcptl = $04A
Bltbpth = $04C
Bltbptl = $04E
Bltapth = $050
Bltaptl = $052
Bltdpth = $054
Bltdptl = $056
Bltsize = $058
Bltcmod = $060
Bltbmod = $062
Bltamod = $064
Bltdmod = $066
Bltcdat = $070
Bltbdat = $072
Bltadat = $074
;Copper Registers
Cop1lc = $080
Cop1lch = $080
Cop1lcl = $082
Cop2lc = $084
Cop2lch = $084
Cop2lcl = $086
Copjmp1 = $088
Copjmp2 = $08A
Diwstrt = $08E
Diwstop = $090
Ddfstrt = $092
Ddfstop = $094
Dmacon = $096
Clxcon = $098
Intena = $09A
Intreq = $09C
;BitPlane Registers
BplCon0 = $100
BplCon1 = $102
BplCon2 = $104
BplMod1 = $108
BplMod2 = $10a
BplPt0h = $0e0
BplPt0l = $0e2
BplPt1h = $0e4
BplPt1l = $0e6
BplPt2h = $0e8
BplPt2l = $0ea
BplPt3h = $0ec
BplPt3l = $0ee
BplPt4h = $0f0
BplPt4l = $0f2
BplPt5h = $0f4
BplPt5l = $0f6
;Colorour Registers
Color00 = $180
Color01 = $182
Color02 = $184
Color03 = $186
Color04 = $188
Color05 = $18a
Color06 = $18c
Color07 = $18e
Color08 = $190
Color09 = $192
Color10 = $194
Color11 = $196
Color12 = $198
Color13 = $19a
Color14 = $19c
Color15 = $19e
Color16 = $1a0
Color17 = $1a2
Color18 = $1a4
Color19 = $1a6
Color20 = $1a8
Color21 = $1aa
Color22 = $1ac
Color23 = $1ae
Color24 = $1b0
Color25 = $1b2
Color26 = $1b4
Color27 = $1b6
Color28 = $1b8
Color29 = $1ba
Color30 = $1bc
Color31 = $1be